import 'package:p_location/alarm/res/alarm_vehicle_item.dart';

class AlarmVehicleRes {
  List<AlarmVehicleItem> data;
  int code;
  int length;

  AlarmVehicleRes({this.data, this.code, this.length});

  factory AlarmVehicleRes.fromJson(Map<String, dynamic> json) {
    return AlarmVehicleRes(
      data: json['data'] != null
          ? (json['data'] as List).map((i) => AlarmVehicleItem.fromJson(i)).toList()
          : null,
      code: json['code'],
      length: json['length'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['length'] = this.length;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
